home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 2005 March
/
CMCD0305.ISO
/
Software
/
Shareware
/
Utilitare
/
emu
/
Emu8086_Setup_307c.exe
/
{app}
/
Samples
/
4_sample.asm
< prev
next >
Wrap
Assembly Source File
|
2002-08-02
|
971b
|
75 lines
#make_BIN#
; This sample shows how
; CMP instruction sets the
; flags.
; Usually CMP instruction
; is followed by any relative
; jump instruction such as:
; JE, JA, JL, JAE...
; NOP instruction does
; nothing (no operation).
; It is recommended to open:
; "Lexical Flag Analyzer"
; and "Flags"
; from emulator's "View"
; menu before running
; this code.
; (Signed/Unsigned)
; 4 is Equal to 4
MOV AH, 4
MOV AL, 4
CMP AH, AL
NOP
; (Signed/Unsigned)
; 4 is Above and
; Greater then 3
MOV AH, 4
MOV AL, 3
CMP AH, AL
NOP
; -5 = 251 = 0FBh
; (Signed)
; 1 is Greater then -5
MOV AH, 1
MOV AL, -5
CMP AH, AL
NOP
; (Unsigned)
; 1 is Below 251
MOV AH, 1
MOV AL, 251
CMP AH, AL
NOP
; (Signed)
; -3 is Less then -2
MOV AH, -3
MOV AL, -2
CMP AH, AL
NOP
; (Signed)
; -2 is Greater then -3
MOV AH, -2
MOV AL, -3
CMP AH, AL
NOP
; (Unsigned)
; 255 is Above 1
MOV AH, 255
MOV AL, 1
CMP AH, AL
NOP
HLT